﻿using System;
using System.Collections.Generic;
//using System.Linq;
using System.Windows.Forms;
using System.Text;
using System.Runtime.Remoting.Channels;
using System.Runtime.Remoting.Channels.Tcp;
using System.Runtime.Remoting;

namespace LoggingSender
{
    static class Program
    {
        /// <summary>
        /// 应用程序的主入口点。
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            //注册通道
            TcpChannel chnl = new TcpChannel(8085);
            ChannelServices.RegisterChannel(chnl);
            string sshan = chnl.ChannelName;
            System.Console.WriteLine(sshan);
            //注册远程对象,即激活.
            RemotingConfiguration.RegisterWellKnownServiceType(typeof(LoggingSender.RemoteHandler), "SendData", WellKnownObjectMode.SingleCall);
            Form1 form1 = new Form1();
            RemoteHandler.form1 = form1;
            Application.Run(form1);
        }
    }
}
